package com.fengshang.wedding.utils;

import java.util.Locale;

import org.springframework.context.MessageSource;
/**
 * 
 *@author gembin@gmail.com
 * 
 */
public class I18NHelper {

	private MessageSource messages;

	public void setMessages(MessageSource messages) {
		this.messages = messages;
	}

	public String getValue(String key) {
		return getValue(key, null, Locale.getDefault());
	}

	public String getValue(String key, Object[] args) {
		return getValue(key, args, Locale.getDefault());
	}

	public String getValue(String key, Object[] args, Locale locale) {
		return messages.getMessage(key, args, locale);
	}

}
